//
//  TableEmptyCell.swift
//  RaveLand
//
//  Created by zhuxuhong on 2021/4/30.
//  Copyright © 2021 CSLY. All rights reserved.
//

import BWUIKit

class TableEmptyCell: TableViewCell, EmptyReusableView {
    private var empty: EmptyView? {
        didSet{
            guard let v = empty else{
                return
            }
            v.backgroundColor = .clear
            contentView.addSubview(v)
            v.snp.makeConstraints { make in
                make.edges.equalToSuperview()
            }
        }
    }
    
    override func didInit() {
        super.didInit()
        
        empty = loadEmptyView()
        selectionStyle = .none
    }
    
    override func bwListItemViewConfigure(_ data: Any?, indexPath: IndexPath) {
        guard let data = data as? EmptyDataWrapper else {
            return
        }
        empty?.updateData(data.value)
    }
}
